package com.zhika.zishi.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.RelativeLayout;
import android.widget.Toast;

import com.zhika.zishi.R;
import com.zhika.zishi.customview.TitleView;
import com.zhika.zishi.interfaces.TitleInterface;
import com.zhika.zishi.util.LogUtil;

/**
 * Created by shi-02 on 2015/4/18.
 */
public class SuperaddMyselfProblemActivity extends BaseActivity {

    private final String TAG = "SuperaddMyselfProblemActivity";

    private TitleView titleView;

    private RelativeLayout pictureLayout;

    private EditText superaddEdit;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.superadd_myself_problem_layout);

        initView();
    }

    private void initView() {

        superaddEdit = (EditText) findViewById(R.id.superadd_myself_problem_content_edit);

        titleView = (TitleView) findViewById(R.id.superadd_myself_problem_title_view);
        titleView.setLeftButtonText("返回");
        titleView.setMiddleRowText("追加");
        titleView.setRightButtonText("发布");
        titleView.setTitleViewInterface(new TitleInterface() {
            @Override
            public void leftTitleListener() {
                finish();
            }

            @Override
            public void middleTitleListener() {

            }

            @Override
            public void rightTitleListener() {
                String superaddStr ="追加："+ superaddEdit.getText().toString();
                LogUtil.e(TAG,superaddStr);
                Intent intent = new Intent(SuperaddMyselfProblemActivity.this, ProblemDetailsActivity.class);
                intent.putExtra("superadd",superaddStr);
                startActivity(intent);
            }
        });

        pictureLayout = (RelativeLayout) findViewById(R.id.superadd_myself_problem_picture_layout);
        pictureLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(SuperaddMyselfProblemActivity.this, "更换图片", Toast.LENGTH_SHORT).show();
            }
        });
    }
}
